<form action="#" class="am-form">
    <fieldset>
        <legend>普通群上限</legend>
        <div class="form_content">
            <div class="input">
                <input type="number" id="limit" class="am-form-field" placeholder="请输入默认的上限值" required/>
            </div>
            <div class="button">
                <button type="button" class="am-btn am-btn-primary btn-limit">保存</button>
            </div>
            <div class="clear"></div>
        </div>

        <div style="padding-top: 30px; padding-left: 10px; color: red;">
            可以为不同群设置不同的成员上限，具体请点击：<a href="#">“群组管理/群组查询”</a>。
        </div>
    </fieldset>
</form>

<script>
    // 刷新配置信息
    Classify.query("group", "limit", false, 500, function(v) {
        $("#limit").val(v);
    });

    $(".btn-limit").click(function() {
        var v = $("#limit").val();
        if (v == '' || parseInt(v) < 1) {
            alert2("群成员上限数量不对！", true);
            return;
        }
        startLoading();
        Classify.save("group", "limit", v, function(r) {
            stopLoading();
            alert2("保存成功！");
        });
    });
</script>
